package com.ruoyi.system.service.impl;

import java.util.List;
import java.util.UUID;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.MaintenanceOrderInfoMapper;
import com.ruoyi.system.domain.MaintenanceOrderInfo;
import com.ruoyi.system.service.IMaintenanceOrderInfoService;

/**
 * 维修单信息Service业务层处理
 * 
 * @author LK
 * @date 2024-06-22
 */
@Service
public class MaintenanceOrderInfoServiceImpl implements IMaintenanceOrderInfoService 
{
    @Autowired
    private MaintenanceOrderInfoMapper maintenanceOrderInfoMapper;

    /**
     * 查询维修单信息
     * 
     * @param maintenanceOrderId 维修单信息主键
     * @return 维修单信息
     */
    @Override
    public MaintenanceOrderInfo selectMaintenanceOrderInfoByMaintenanceOrderId(String maintenanceOrderId)
    {
        return maintenanceOrderInfoMapper.selectMaintenanceOrderInfoByMaintenanceOrderId(maintenanceOrderId);
    }

    /**
     * 查询维修单信息列表
     * 
     * @param maintenanceOrderInfo 维修单信息
     * @return 维修单信息
     */
    @Override
    public List<MaintenanceOrderInfo> selectMaintenanceOrderInfoList(MaintenanceOrderInfo maintenanceOrderInfo)
    {
        return maintenanceOrderInfoMapper.selectMaintenanceOrderInfoList(maintenanceOrderInfo);
    }

    /**
     * 新增维修单信息
     * 
     * @param maintenanceOrderInfo 维修单信息
     * @return 结果
     */
    @Override
    public int insertMaintenanceOrderInfo(MaintenanceOrderInfo maintenanceOrderInfo)
    {
        String workOrderId = maintenanceOrderInfo.getWorkOrderId();
        maintenanceOrderInfo.setMaintenanceOrderId(workOrderId);
        return maintenanceOrderInfoMapper.insertMaintenanceOrderInfo(maintenanceOrderInfo);
    }

    /**
     * 修改维修单信息
     * 
     * @param maintenanceOrderInfo 维修单信息
     * @return 结果
     */
    @Override
    public int updateMaintenanceOrderInfo(MaintenanceOrderInfo maintenanceOrderInfo)
    {
        return maintenanceOrderInfoMapper.updateMaintenanceOrderInfo(maintenanceOrderInfo);
    }

    /**
     * 批量删除维修单信息
     * 
     * @param maintenanceOrderIds 需要删除的维修单信息主键
     * @return 结果
     */
    @Override
    public int deleteMaintenanceOrderInfoByMaintenanceOrderIds(String[] maintenanceOrderIds)
    {
        return maintenanceOrderInfoMapper.deleteMaintenanceOrderInfoByMaintenanceOrderIds(maintenanceOrderIds);
    }

    /**
     * 删除维修单信息信息
     * 
     * @param maintenanceOrderId 维修单信息主键
     * @return 结果
     */
    @Override
    public int deleteMaintenanceOrderInfoByMaintenanceOrderId(String maintenanceOrderId)
    {
        return maintenanceOrderInfoMapper.deleteMaintenanceOrderInfoByMaintenanceOrderId(maintenanceOrderId);
    }
}
